class Admin::KarmasController <  Admin::AdminController
  
  def index
    @karmas = Karma.paginate(:page => params[:page], :per_page=>25)
  end
  
  def new
    @karma = Karma.new
  end
  
  def create
    @karma = Karma.new(params[:karma])
    
    if @karma.save
      flash_notice(:karma_created)
      redirect_to admin_karmas_path
    else 
      flash_error(:karma_not_created)
      render :new
    end   
  end
  
  def destroy
    @karma = Karma.find(params[:id])
    if @karma.destroy
      flash_notice(:karma_removed)
      redirect_to(admin_karmas_url) 
    else
      flash_error(:karma_not_removed)
      redirect_to(admin_karmas_url) 
    end
  end
end
